From 1db798cdbeea651f5c671c646ee0fc3b15a6dc0e Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Thu, 12 Apr 2007 15:54:59 +0100 Subject: [PATCH] [HVM] Save/restore: catch more error cases in the tools Signed-off-by: Tim Deegan --- tools/libxc/xc_domain_restore.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c index 1b52c90e5b..aaabed6d42 100644 --- a/tools/libxc/xc_domain_restore.c +++ b/tools/libxc/xc_domain_restore.c @@ -688,12 +688,21 @@ int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom, ERROR("error zeroing magic pages"); goto out; } - - xc_set_hvm_param(xc_handle, dom, HVM_PARAM_IOREQ_PFN, magic_pfns[0]); - xc_set_hvm_param(xc_handle, dom, HVM_PARAM_BUFIOREQ_PFN, magic_pfns[1]); - xc_set_hvm_param(xc_handle, dom, HVM_PARAM_STORE_PFN, magic_pfns[2]); - xc_set_hvm_param(xc_handle, dom, HVM_PARAM_PAE_ENABLED, pae); - xc_set_hvm_param(xc_handle, dom, HVM_PARAM_STORE_EVTCHN, store_evtchn); + + if ( (rc = xc_set_hvm_param(xc_handle, dom, + HVM_PARAM_IOREQ_PFN, magic_pfns[0])) + || (rc = xc_set_hvm_param(xc_handle, dom, + HVM_PARAM_BUFIOREQ_PFN, magic_pfns[1])) + || (rc = xc_set_hvm_param(xc_handle, dom, + HVM_PARAM_STORE_PFN, magic_pfns[2])) + || (rc = xc_set_hvm_param(xc_handle, dom, + HVM_PARAM_PAE_ENABLED, pae)) + || (rc = xc_set_hvm_param(xc_handle, dom, + HVM_PARAM_STORE_EVTCHN, store_evtchn)) ) + { + ERROR("error setting HVM params: %i", rc); + goto out; + } *store_mfn = magic_pfns[2]; /* Read HVM context */ -- 2.30.2